﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using NVSecurity.Models;

namespace NVSecurity.Controllers
{
    public class NewsController : Controller
    {
        NVSecurityEntities db = new NVSecurityEntities();
        //
        // GET: /News/

        public ActionResult Index()
        {
            return View();
        }
        public ActionResult GetNewsList()
        {
            var newsList = db.News.OrderByDescending(m => m.CreateDate).ToList();
            return View(newsList);
        }
        public ActionResult Detail(int id)
        {
            var news = db.News.Find(id); ;
            return View(news);
        }

    }
}
